<?php
$hide_right_sidebar = true;
//require_once('./wp-load.php');
require_once('./wp-admin/includes/admin.php');
?>


<?php if (current_user_can('create_users')) : ?>
<header><h2>Registrer et nytt medlem</h2></header>
<form action="<?php the_permalink() ?>" method="post">  
    <table class="form-regnyttmedlem">
        <tr class="form-field form-required">
            <th>
                <label for="user_login"><?php _e('Brukernavn'); ?> <span class="description"><?php _e('(Påkrevd)'); ?></span></label>
            </th>
            <td>
                <input name="user_login" type="text" id="user_login" value="<?php echo esc_attr($new_user_login); ?>" aria-required="true" />
            </td>
	</tr>
        <tr class="form-field form-required">
            <th>
                <label for="email"><?php _e('Epost'); ?> <span class="description"><?php _e('(Påkrevd)'); ?></span></label>
            </th>
            <td>
                <input name="email" type="text" id="email" value="<?php echo esc_attr($new_user_email); ?>" />
            </td>
	</tr>
	<tr class="form-field form-required">
            <th>
                <label for="pass1"><?php _e('Passord'); ?> <span class="description"><?php /* translators: password input field */_e('(To ganger, Påkrevd)'); ?></span></label>
            </th>
            <td>
                <input name="pass1" type="password" id="pass1" autocomplete="off" />
                <br />
                <input name="pass2" type="password" id="pass2" autocomplete="off" />
            </td>
	</tr>
        <tr>
            <th>
                <label for="role"><?php _e('Rolle'); ?></label>
            </th>
            <td>
                <select name="role" id="role">
			//<?php
			if ( !$new_user_role )
				$new_user_role = !empty($current_role) ? $current_role : get_option('default_role');
			wp_dropdown_roles($new_user_role);
			?>
                </select>
            </td>
	</tr>
    </table>
    <?php do_action('register_form') ?>
    <input name="action" type="submit" value="Registrer" id="register" />
    <input name="action" type="submit" value="Avbryt"/>
</form>

<?php else : ?>
    <?php e_("Ingen Tilgang."); ?>

<?php endif; ?>